package com.sl.u_push_plugin_example

import android.content.Intent
import android.os.Bundle
import com.sl.u_push_plugin.MessageManager
import com.sl.u_push_plugin.PushManager
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        intent.extras?.run {
            keySet().forEach {
                this[it]?.run {
                    MessageManager.instance.addColdStarData(it, this.toString());
                }
            }
            MessageManager.instance.buildMessageMap();
        }


    }

    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        MessageManager.instance.setIntentJson(intent)
    }
}
